<?php
$statuses=$formData['statuses'];$hrreferents=$formData['hrreferents']; $users=$formData['users'];
//echo $this->Form->create();
?>

    <fieldset>
        <legend><?php __('Add New User'); ?></legend>
<?php
             echo $this->Form->input('user_name',array('label'=>array('text'=>__('Name',true),'class'=>'required')));
             echo $this->Form->input('user_surname',array('label'=>array('text'=>__('Surname',true),'class'=>'required')));
             echo $this->Form->input('user_status_id',array('options'=>$statuses,'empty'=>'select','label'=>array('text'=>__('Status',true),'class'=>'required')));
             echo $this->Form->input('user_contract_begin',array('type'=>'text','empty'=>'select','label'=>__('Contract Begin',true)));
             echo $this->Form->input('user_contract_end',array('type'=>'text','empty'=>'select','label'=>__('Contract End',true)));
             
             echo $this->Form->input('user_id_code',array('label'=>array('text'=>__('E-mail',true))));
             echo $this->Form->input('user_id_erp',array('label'=>array('text'=>__('Id Erp',true))));
             echo $this->Form->input('user_id_win',array('label'=>array('text'=>__('Id Win',true))));
             echo $this->Form->input('user_id_hr',array('label'=>array('text'=>__('Id Hr',true))));
             //echo $this->Form->input('user_backup_of',array('label'=>__('Backup Of',true)));

             ?>
<table>
    <tbody>
        <tr>
            <td>
                <?php echo $this->Form->input('user_hrreferent_id',array('options'=>$hrreferents,'empty'=>'select','label'=>array('text'=>__('Hrreferent',true),'class'=>'required'))); ?>
            </td>
            <td>
                <div class="showNextBtn filter">
                    <?php echo $this->Html->link(__('Search User',true),array('controller'=>'Users','action'=>'filterUsers','DmdformUserHrreferentId'),array('class'=>'DmdformUserHrreferentId','rel'=>'mybox','dmdcode'=>'Search Hrreferent'));  ?>
                </div>
            </td>
        </tr>
        <tr >
            <td>
                <div class="showNextBtn showNextDiv"><?php __('Not in this List ?');  ?></div>
                <div class="isHidden">
                    <?php echo $this->Form->input('user_hrreferent_name',array('label'=>__('Hrreferent Name',true))); ?>
                </div>
            </td>
        </tr>
        <tr >
            <td>
                <div class="showNextDiv showNextBtn isHidden"><?php __('Details')  ?></div>
                <div class="isHidden showUserHrreferentId">

                </div>
            </td>
        </tr>
        
        <tr >
            <td>
                <div class="showNextDiv showNextBtn isHidden"><?php __('Details')  ?></div>
                <div class="isHidden showUserBackUpOf">

                </div>
            </td>
        </tr>
        <tr>
            <td>
                <?php echo $this->Form->input('user_replace',array('options'=>$users,'empty'=>'select','label'=>__('Replace',true))); ?>
            </td>
            <td>
                <div class="showNextBtn filter">
                    <?php echo $this->Html->link(__('Search User',true),array('controller'=>'Users','action'=>'filterUsers','DmdformUserReplace'),array('class'=>'DmdformUserReplace','rel'=>'mybox','dmdcode'=>'Search Replace'));  ?>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="showNextBtn showNextDiv"><?php __('Not in this List ?');  ?></div>
                <div class="isHidden">
                    <?php echo $this->Form->input('user_replace_comment',array('label'=>__('Comment',true))); ?>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="showNextDiv showNextBtn isHidden"><?php __('Details')  ?></div>
                <div class="isHidden showUserReplace">

                </div>
            </td>
        </tr>
    </tbody>
</table>
            <?php
            // echo $this->Form->input('user_replace',array('label'=>__('Replace',true)));
?>
    </fieldset>

<?php
//echo $this->Form->end();
?>
<script type="text/javascript">
     $(function() {
		var dates = $( "#DmdformUserContractBegin, #DmdformUserContractEnd" ).datepicker({			
			changeMonth: true,
                        dateFormat: 'yy-mm-dd'});
     });
</script>